﻿using Hsp.Auto.Model.Models;
using System;
using System.Collections.Generic;
using System.Text;

namespace Hsp.Auto.Interface
{
    public interface ITableService : IDbHelper
    {
        /// <summary>
        /// 获取当前数据库名称
        /// </summary>
        /// <returns></returns>
        string CurrentDbName();

        /// <summary>
        /// 表列表信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <returns></returns>
        List<T> TableList<T>();

        /// <summary>
        /// 表列表信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <param name="dbName">库名称</param>
        /// <param name="tableNames">库表名称集合，逗号隔开</param>
        /// <returns></returns>
        List<T> TableList<T>(string dbName, string tableNames);

        /// <summary>
        /// 视图列表信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <param name="dbName">库名称</param>
        /// <returns></returns>
        List<T> ViewList<T>(string dbName);

        /// <summary>
        /// 表字段列表信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <returns></returns>
        List<T> ColumnList<T>();

        /// <summary>
        /// 表字段列表信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <param name="tableNames">库表名称集合，逗号隔开</param>
        /// <returns></returns>
        List<T> ColumnList<T>(string tableNames);

        /// <summary>
        /// 表字段列表信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <param name="dbName">库名称</param>
        /// <param name="tableNames">库表名称集合，逗号隔开</param>
        /// <returns></returns>
        List<T> ColumnList<T>(string dbName, string tableNames);

        /// <summary>
        /// 视图字段列表信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <param name="dbName">库名称</param>
        /// <returns></returns>
        List<T> ViewColumnList<T>(string dbName);

        /// <summary>
        /// 表主键列应用信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <returns></returns>
        List<T> KeyColumnList<T>();

        /// <summary>
        /// 表主键列应用信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <param name="tableNames">库表名称集合，逗号隔开</param>
        /// <returns></returns>
        List<T> KeyColumnList<T>(string tableNames);

        /// <summary>
        /// 表主键列应用信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <param name="dbName">库名称</param>
        /// <param name="tableNames">库表名称集合，逗号隔开</param>
        /// <returns></returns>
        List<T> KeyColumnList<T>(string dbName, string tableNames);

        /// <summary>
        /// 表被引用数据信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <returns></returns>
        List<T> ReferenceList<T>();

        /// <summary>
        /// 表被引用数据信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <param name="tableNames">库表名称集合，逗号隔开</param>
        /// <returns></returns>
        List<T> ReferenceList<T>(string tableNames);

        /// <summary>
        /// 表被引用数据信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <param name="dbName">库名称</param>
        /// <param name="tableNames">库表名称集合，逗号隔开</param>
        /// <returns></returns>
        List<T> ReferenceList<T>(string dbName, string tableNames);

        /// <summary>
        /// 表注释中可添加枚举数据信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <returns></returns>
        List<T> EnumList<T>();

        /// <summary>
        /// 表注释中可添加枚举数据信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <param name="dbName">库表名称集合，逗号隔开</param>
        /// <returns></returns>
        List<T> EnumList<T>(string dbName);


        /// <summary>
        /// 表索引数据信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <returns></returns>
        List<T> IndexList<T>();

        /// <summary>
        /// 表索引数据信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <param name="tableNames">表名称集合</param>
        /// <returns></returns>
        List<T> IndexList<T>(string tableNames);

        /// <summary>
        /// 表索引数据信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <param name="dbName">数据库名称</param>
        /// <param name="tableNames">表名称集合</param>
        /// <returns></returns>
        List<T> IndexList<T>(string dbName, string tableNames);


        /// <summary>
        /// 表字段列表信息
        /// </summary>
        /// <typeparam name="T">泛型类型</typeparam>
        /// <returns></returns>
        List<Columns> SqliteColumnList<T>(string tableNames);
    }
}
